package 笔试记录.M8day25奇安信;


import java.util.*;

public class Solution1 {
    static List<String> list = new LinkedList<>();

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String res  = sc.nextLine();
        System.out.println(solve1(res));
    }

    public static List<String> solve1(String digits){
        if(digits.length() == 0 || digits == null) return list;
        String[] numString = {"","abc","def","ghi","jkl","mno","pqr","stu","vwx","yz"};
        backStacking(digits,numString,0);
        for (int i = 0;i < list.size();i++){
            list.set(i,"'"+list.get(i)+"'");
        }
        return list;
    }

    static StringBuilder str = new StringBuilder();//构建字符串，用来返回

    public static void backStacking(String digits,String[] numString,int num){
        if(num == digits.length()){
            list.add(str.toString());
            return;
        }
        String myStr = numString[digits.charAt(num) - '0'];
        for(int i = 0;i < myStr.length();i++){
            str.append(myStr.charAt(i));
            backStacking(digits,numString,num+1);
            str.deleteCharAt(str.length() - 1);
        }
    }
}
